package com.github.beihaifeiwu.myspring.core.feign;

import com.github.beihaifeiwu.myspring.http.feign.FeignClient;
import feign.Headers;
import feign.Param;
import feign.RequestLine;

/**
 * HttpBin.org service definition
 */
@FeignClient(value = "http://httpbin.org", configurer = "postConfigurer")
@Headers("Accept: application/json")
public interface HttpPostService {

    // POST form encoded with form field params
    @RequestLine("POST /post")
    @Headers("Content-Type: application/x-www-form-urlencoded")
    HttpBinResponse postWithFormParams(@Param("field1") String field1);

    // POST form encoded with form field params
    @RequestLine("POST /post")
    @Headers("Content-Type: application/json")
    HttpBinResponse postWithJson(LoginData loginData);

}